package hotel.jpa;

import java.util.Date;
import java.util.List;
import javax.persistence.EntityManager;

/**
 * A interface sets methods for connecting to the
 * database. 
 * 
 * @author Anton Karlsson
 */
public interface IJpaCtrl<T> {
    
    void create(T t);
    
    void destroy(T t);
    
    void edit(T t);
    
    T findEntity(T t) throws NonexistentEntityException;
    
    List<T> findEntities();
    
    List<T> findAvailableRooms(int roomNb);
    
    EntityManager getEntityManager();
    
    int getEntityCount();
}
